package china.lzy.entity;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @author ：lzy
 * @ Date       ：Created in 15:01 2021/8/9
 * @ Description：返回的编码
 */

public enum ResCode {
    SAVE_OK(2001, "保存成功！"),
    DELETE_OK(2002, "删除成功！"),
    LOGIN_OK(2003, "登录成功!"),
    OPERATE_OK(2004, "操作成功!"),


    LOGIN_FAIL(4003, "登录失败!"),
    SAVE_FAIL(4001, "保存失败!"),
    AUTH_ERROR(4002, "权限不住"),


    SYSTEM_ERROR(5001, "系统错误"),
    SYSTEM_BUSY(5002, "系统繁忙"),
    PARAM_ERROR(5003, "参数错误"),
    OPERATE_ERROR(5004, "操作失败");

    private Integer code;
    private String message;

    //创建方法
    private ResCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    @Override
    public String toString() {
        return "ResCode{" +
                "Code=" + code +
                ", message='" + message + '\'' +
                '}';
    }
}
